
<h3>Listado de Denuncias</h3>
<% if flash[:notice] %>
    <div id="notice"><%= flash[:notice] %></div>
<% end %>
<br />

<% form_tag url_for(:action=>"update_table"),{:id =>"complaints_form_search"} do -%>

   
<fieldset id="agrupacion" >
   <legend>Criterio de Búsqueda</legend>
  <fieldset class="column-left">
     <p class="two-col"><label>Criterio: </label><%=  select_tag "field_name",  options_for_select([["Todos","Todos"],["DNI","DNI"],["Nombre","Nombre"], ["Nro Denuncia","Nro Denuncia"]]) %></p>
  </fieldset>

   <fieldset class="column-right">
    <p class="two-col"><label>Campo:</label><%= text_field_tag "search_id" %></p>
  </fieldset>
    
</fieldset>

 <fieldset id="agrupacion" >
   <fieldset class="column-left">

      <p class="two-col"><label>Tipo de Denuncia:  </label><%= select_tag "search_complaint_type", options_for_select(@complaint_types.collect {|t| [t.name, t.id]}),:include_blank=>"Seleccione" %></p>

      <% if user_signed_in? && [7].include?(current_user.role)%>
     <p class="two-col"><label>Estado de Denuncia:  </label><%= select_tag "search_complaint_state", options_for_select(RequestAndComplaint::Complaint.list_states_admin) %></p>
   <% end %>
      <% if user_signed_in? && [5].include?(current_user.role)%>
     <p class="two-col"><label>Estado de Denuncia:  </label><%= select_tag "search_complaint_state", options_for_select(RequestAndComplaint::Complaint.list_states) %></p>
   <% end %>

   </fieldset>
   <% if user_signed_in? && [7].include?(current_user.role)%> 
   <fieldset class="column-right">
   <p class="two-col"><label>Asignar a:  </label><%= select_tag "complaint_responsible", options_for_select( @users.collect {|t| [t.name, t.id]}),:include_blank=>"Seleccione" %></p>
   <input class="button" name="Buscar" value="Buscar" type="submit" />
   </fieldset>
   <% end %>

   
   </fieldset>
   
<% end %>
 
<br />
<div id="complaints_table">
    <%= render :partial=>"table" %>
</div>

<br />

<%= link_to 'Nueva Denuncia', new_request_and_complaint_complaint_path %>
